package cn.zhx.xa.bi.ws;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;



@Component
public class WebSocketTask {
    @Resource
    private WebSocketServer webSocketServer;

    /**
     * 通过WebSocket每隔5秒向客户端发送消息
     */
    //@Scheduled(cron = "0/5 * * * * ?")
//    public void sendMessageToClient() {
//        webSocketServer.sendToAllClient("这是来自服务端的消息" );
//    }
}
